from django.contrib import admin
from django.urls import path, include, re_path
from app01 import views
from web.views import account, home, project, manage

urlpatterns = [
    path('register/', account.register, name='register'),
    path('login/', account.login, name='login'),
    path('img_code/', account.img_code, name='img_code'),
    path('logout/', account.logout, name='logout'),
    path('index/', home.index, name='index'),

    # 项目管理
    path('project/list/', project.project_list, name='project_list'),
    path('project/star/(?P<project_type>\w+)/(?P<project_id>\d+)/', project.project_star, name='project_star'),
    path('project/unstar/(?P<project_type>\w+)/(?P<project_id>\d+)/', project.project_unstar, name='project_unstar'),

    # path('manage/(?P<project_id>\d+)/', include([
    #     path('dashboard/', manage.dashboard, name='dashboard'),
    #     path('issues/', manage.issues, name='issues'),
    #     path('statistics/', manage.statistics, name='statistics'),
    #     path('file/', manage.file, name='file'),
    #     path('wiki/', manage.wiki, name='wiki'),
    #     path('setting/', manage.setting, name='setting'),
    # ]))
    re_path('manage/(?P<project_id>\d+)/', include([
        path('dashboard/', manage.dashboard, name='dashboard'),
        path('issues/', manage.issues, name='issues'),
        path('statistics/', manage.statistics, name='statistics'),
        path('file/', manage.file, name='file'),
        path('wiki/', manage.wiki, name='wiki'),
        path('setting/', manage.setting, name='setting'),
    ]))
]
